<?php

namespace AdminPanel\QuestionBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ExamQuestionType extends AbstractType
{
  private $showType = array(0 => 'Текст');
  private $questionType = array(0 => 'Ганц сонголт', 1 => 'Олон сонголт');
  private $isActiveChoiceArray = array(0 => 'Үгүй', 1 => 'Тийм');
  
  public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('question', 'text', array(
                'label' => 'Асуулт'
                
            ))
            ->add('sortOrder')
            ->add('showType')
            ->add('showType', 'choice', array(
                'label' => 'Харагдах хэлбэр',
                'choices' => $this->showType,
                'required' => true,
                'expanded' => true,
                'multiple' => false
            ))
            ->add('questionType', 'choice', array(
                'label' => 'Асуултын хэлбэр',
                'choices' => $this->questionType,
                'required' => true,
                'expanded' => true,
                'multiple' => false
            ))
            ->add('isActive', 'choice', array(
                'label' => 'Идэвхитэй эсэх',
                'choices' => $this->isActiveChoiceArray,
                'required' => true,
                'expanded' => true,
                'multiple' => false
            ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'AdminPanel\QuestionBundle\Entity\ExamQuestion'
        ));
    }

    public function getName()
    {
        return 'adminpanel_Questionbundle_examQuestiontype';
    }
}
